// Copyright (c) 2022, hzmes and contributors
// For license information, please see license.txt

frappe.ui.form.on('SRM NewMold', {
	refresh: function(frm) {
        if ( frappe.user_roles.includes('SRM Purchase') ) {
            frm.add_custom_button(__('费用确认'), () => {
                frappe.prompt('Amount', ({ value }) => {frm.set_value('amount_of_money', value); frm.refresh_field('amount_of_money'); frm.save();})
            });
        };

		frm.add_custom_button(__('返回公共查询'), () => {
			frappe.set_route('query-report', 'SRM NewMold Rep', {})
		}).addClass('btn-primary');
		
	},
});
